#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
using namespace std;

int main()
{
	int day = 0;
	scanf("%d", &day);

	int newday = 0;
	newday = day + 2;
	if (newday > 7)
	{
		newday -= 7;
	}

	printf("%d", newday);
	return 0;
}
